package com.eorchis.module.interioruser.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.eorchis.core.basedao.entity.IBaseEntity;
import com.eorchis.module.user.domain.User;

/**
 * Title: InteriorUser<br>
 * Description: 内部用户实体对象<br>
 * Company: GoldGov<br>
 * Copyright @ 2012 GoldGov .All rights reserved.<br>
 * @author Administrator
 * @createDate 2015-01-04
 * @version $Revision$
 */
@Entity
@Table(name = "INTERIOR_USER")
public class InteriorUser implements IBaseEntity {
	private static final long serialVersionUID = 1L;

	private String userid;//用户id
	private String userName;//用户名称
	private User user;//外部用户
	

	@Id
	@Column(name="USERID")
	/**
	 * 设置用户id
	 */		
	public String getUserid() {
		return userid;
	}
	/**
	 * 获取用户id
	 */		
	public void setUserid(String userid) {
		this.userid = userid;
	}
	@Column(name="USER_NAME")
	/**
	 * 设置用户名称
	 */		
	public String getUserName() {
		return userName;
	}
	/**
	 * 获取用户名称
	 */		
	public void setUserName(String userName) {
		this.userName = userName;
	}
	/**
	 * 设置登录号
	 */	
	public void setUser(User user) {
		this.user = user;
	}
	/**
	 * 获取登录号
	 */
	@ManyToOne(fetch = FetchType.LAZY, optional = true)
	@JoinColumn(name="LOGIN_ID", referencedColumnName = "LOGIN_ID")	
	public User getUser() {
		return user;
	}
	/**
	 * 记录日志使用
	 */
	public String toString() {
		return "用户id======>" + getUserid()+"\n用户名称======>" + getUserName();
	}
	
}
